# Maintainer: Dekedro <dekedro@tankers.xyz>
pkgname=linux-apfs-rw-src
_modname=linux-apfs-rw
pkgver=0_git20210823
_commit=0b5ba5e5a953786615f9fe30e2d49ce24187b451
pkgrel=0
pkgdesc="APFS module for linux, with experimental write support (sources, AKMS)"
url="https://github.com/linux-apfs/linux-apfs-rw"
arch="noarch"
license="GPL-2.0-only"
options="!check" # no tests
source="$_modname-$pkgver.tar.gz::https://github.com/linux-apfs/linux-apfs-rw/archive/$_commit.tar.gz
	modules-load.conf"
builddir="$srcdir/$_modname-$_commit"

prepare() {
	default_prepare

	cat >AKMBUILD <<- EOF
	modname=$_modname
	modver=$pkgver-r$pkgrel
	built_modules='apfs.ko'
	EOF
}

package() {
	install -Dm644 -t "$pkgdir/usr/src/$_modname-$pkgver" -- *.c *.h \
		Makefile AKMBUILD
	install -Dm644 "$srcdir"/modules-load.conf \
		"$pkgdir"/usr/lib/modules-load.d/$_modname.conf
}

sha512sums="
b8999e68b4ff83808dfef46f4127ec58bbd0736ad001d11e905379b2e880878d22bad8607122064a3f2b455255ed4a7e6eb6a04b2c98ffdd700cfd3bea529827  linux-apfs-rw-0_git20210823.tar.gz
d49b16b7d824cf9fa21461723827791b50035f521046718d1bbbf4ea3b60ecd12822e8e7adbb3dab9f946bfcd04217810c1358d7e194199e84fc6339cc1568a8  modules-load.conf
"
